package br.mikhas.container.application;

import br.mikhas.container.config.BeanDefinitionProvider;
import br.mikhas.container.factory.BeanFactory;

/**
 * Context which expose the IOC container functionalities to be used by other
 * applications.
 * <p>
 * It's responsible by initializing the application context, scope and the
 * resource container.
 * <p>
 * It demands a {@link BeanDefinitionProvider} to feed the container with
 * managed resources.
 * 
 * @author Mikhail Domanoski
 * 
 */
public interface ApplicationContext extends BeanFactory {

	/**
	 * Initializes the application context, scope and IOC container.
	 */
	public void initializeContext();

	/**
	 * Sets the {@link BeanDefinitionProvider} to teh context.
	 * <p>
	 * It's required to initialize the IOC container.
	 * 
	 * @param provider
	 *            a non-null definition provider
	 */
	public void setResourceProvider(BeanDefinitionProvider provider);

	/**
	 * Gets the current registered {@link BeanDefinitionProvider}.
	 * <p>
	 * Thie method should be used intenally by the applcation context to get the
	 * resources.
	 * 
	 * @return The current registered {@link BeanDefinitionProvider}
	 */
	public BeanDefinitionProvider getResourceProvider();
}
